﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using CrystalDecisions.Shared;

namespace QuanLyDoiXe
{
    public partial class frminbaocaosudungnhienlieu : Form
    {
        public frminbaocaosudungnhienlieu()
        {
            InitializeComponent();
        }
        private ParameterFields paramFields = null;
        inbcsudungnhienlieu document = new inbcsudungnhienlieu();
        private void frminbaocaosudungnhienlieu_Load(object sender, EventArgs e)
        {
            paramFields = new ParameterFields();
            setTitle(crystalReportViewer1, "praxe", frmbaocaosudungnhienlieu.Xechay);
            setTitle(crystalReportViewer1, "praquangduong", frmbaocaosudungnhienlieu.QD);
            setTitle(crystalReportViewer1, "pradinhmuc", frmbaocaosudungnhienlieu.DM);
            setTitle(crystalReportViewer1, "praxangtieuthu", frmbaocaosudungnhienlieu.Xtieuthu);
            setTitle(crystalReportViewer1, "prathangbc", frmbaocaosudungnhienlieu.TBC);
            crystalReportViewer1.ReportSource = document;
        }
        private void setTitle(CrystalDecisions.Windows.Forms.CrystalReportViewer crysRV, string namePara, string columnValue)
        {
            ParameterField paramField = new ParameterField();
            paramField.Name = namePara;
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
            paramDiscreteValue.Value = columnValue;
            paramField.CurrentValues.Add(paramDiscreteValue);
            paramFields.Add(paramField);
            crysRV.ParameterFieldInfo = paramFields;
        }
    }
}
